// pages/tools/tools.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    theme: '',
    library: [
      {
        id: 1,
        src: '/packageMore/images/tools/element.png',
        url: 'https://element.faas.ele.me/#/zh-CN',
        tit: 'Element',
        label: 'Vue'
      }, {
        id: 2,
        src: '/packageMore/images/tools/iview.png',
        url: 'https://www.iviewui.com/',
        tit: 'View Design',
        label: 'Vue'
      }, {
        id: 3,
        src: '/packageMore/images/tools/vant.png',
        url: 'https://vant-ui.github.io/vant/v2/#/zh-CN/',
        tit: 'Vant',
        label: 'Vue'
      }, {
        id: 4,
        src: '/packageMore/images/tools/mintui.png',
        url: 'https://mint-ui.github.io/#!/zh-cn',
        tit: 'Mint UI',
        label: 'Vue'
      }, {
        id: 5,
        src: '/packageMore/images/tools/vux.png',
        url: 'https://vux.li/',
        tit: 'VUX',
        label: 'Vue'
      }, {
        id: 6,
        src: '/packageMore/images/tools/ant_design_vue.svg',
        url: 'https://antdv.com/components/overview',
        tit: 'Ant Design Vue',
        label: 'Vue'
      }, {
        id: 7,
        src: '/packageMore/images/tools/BootstrapVue.png',
        url: 'https://bootstrap-vue.org/',
        tit: 'BootstrapVue',
        label: 'Vue'
      }, {
        id: 8,
        src: '/packageMore/images/tools/ant_design.png',
        url: 'https://ant-design.antgroup.com/index-cn',
        tit: 'Ant Design',
        label: 'React'
      }, {
        id: 9,
        src: '/packageMore/images/tools/ant_design_mobile.svg',
        url: 'https://mobile.ant.design/zh/',
        tit: 'Ant Design Mobile',
        label: 'React'
      }, {
        id: 10,
        src: '/packageMore/images/tools/ReactBootstrap.png',
        url: 'http://react.tgwoo.com/',
        tit: 'React-Bootstrap',
        label: 'React'
      }, {
        id: 11,
        src: '/packageMore/images/tools/ZarmDesign.svg',
        url: 'https://zarm.design/#/',
        tit: 'Zarm Design',
        label: 'React'
      }, {
        id: 12,
        src: '/packageMore/images/tools/vant.png',
        url: 'https://vant-contrib.gitee.io/vant-weapp/#/quickstart',
        tit: 'Vant Weapp',
        label: '小程序'
      }, {
        id: 13,
        src: '/static/icon/study/xiaochengxu.png',
        url: 'https://weui.io/',
        tit: 'WeUI',
        label: '小程序'
      }, {
        id: 14,
        src: '/packageMore/images/tools/iview weapp.png',
        url: 'https://weapp.iviewui.com/',
        tit: 'iView Weapp',
        label: '小程序'
      }, {
        id: 15,
        src: '/packageMore/images/tools/logo-taro.png',
        url: 'https://taro-ui.jd.com/#/',
        tit: 'Taro UI',
        label: '小程序'
      }, {
        id: 16,
        src: '/packageMore/images/tools/WuxWeapp.png',
        url: 'https://wux-weapp.github.io/wux-weapp-docs/#/',
        tit: 'Wux Weapp',
        label: '小程序'
      }, {
        id: 17,
        src: '/packageMore/images/tools/LinUI.jpeg',
        url: 'https://doc.mini.talelin.com/',
        tit: 'Lin UI',
        label: '小程序'
      }
    ],
    internet: [
      {
        id: 1,
        src: '/static/img/logo.png',
        url: '1',

        tit: '测试'
      }, {
        id: 2,
        src: '/static/img/logo.png',
        url: '1',

        tit: '测试'
      }, {
        id: 3,
        src: '/static/img/logo.png',
        url: '1',

        tit: '测试'
      }
    ],
  },

  copy(e) {
    const { id } = e.currentTarget.dataset
    const { library } = this.data
    const data = library.filter(i => i.id == id)
    wx.setClipboardData({
      data: data[0].url,
      success(res) {
        wx.showToast({
          title: '网址复制成功',
          icon: 'none'
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    const theme = wx.getStorageSync('systemTheme');
    this.setData({
      theme
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  },

  // 分享到朋友圈
  onShareTimeline() { },
})